home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / text / hyper / ADtoHT2_1.lha / Source.lha / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-23  |  2.2 KB  |  101 lines

  1. #ifndef MAIN_H
  2. #define MAIN_H
  3.  
  4. #ifndef DOS_DOSEXTENS_H
  5. #include <dos/dosextens.h>
  6. #endif
  7.  
  8. #ifndef _AMIGA_H_
  9. #include <Amiga.h>
  10. #endif
  11.  
  12. #if defined(DEBUG) && !defined(_STDIO_H_)
  13. #include <stdio.h>
  14. #endif
  15.  
  16. #ifndef AVL_H
  17. #include "AVL.h"
  18. #endif
  19.  
  20. /************************************************************************/
  21.  
  22. struct AnyNode
  23.   {
  24.     struct AVLNode AVLNode;
  25.     char *Name;
  26.   };
  27.  
  28. int nodecmp (struct AVLNode *, struct AVLNode *);
  29. int nodecasecmp (struct AVLNode *, struct AVLNode *);
  30.  
  31. struct AnyNode *CreateNode (const char *, size_t);
  32.  
  33. /************************************************************************/
  34.  
  35. #define INCLUDEDIR    0
  36. #define HYPERINCLUDEDIR    1
  37. #define AUTODOCDIR    2
  38. #define HYPERAUTODOCDIR    3
  39. #define DIRCOUNT    4
  40. #define CURRENTDIR    DIRCOUNT
  41.  
  42. struct Arguments
  43.   {
  44.     char *Dirs[DIRCOUNT];
  45.     char *Master;        /* filename of master document */
  46.     char *XREF;            /* filename of xref file */
  47.     long FullPath;
  48.     long *Version;        /* version of amigaguide */
  49.     long Parentheses;        /* add () to nodenames as well */
  50.     long *Width;        /* characters/line */
  51. #ifdef DEBUG
  52.     char *Debug;
  53. #endif
  54.   };
  55.  
  56. /************************************************************************/
  57.  
  58. extern struct DosLibrary *DOSBase;
  59.  
  60. extern struct Arguments Arguments;
  61.  
  62. extern int Pass2;
  63.  
  64. extern BPTR Dirs[DIRCOUNT + 1];
  65.  
  66. #ifdef DEBUG
  67. extern FILE *DebugFile;
  68. #endif
  69.  
  70. /************************************************************************/
  71.  
  72. void *xmalloc(size_t);
  73. void *xrealloc (void *, size_t);
  74. char *xstrdup (const char *);
  75.  
  76. void SetRC (int);
  77.  
  78. void CloseAll(int) NORETURN;
  79.  
  80. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  81. /************************************************************************/
  82. /*                                                                      */
  83. /* Search an AnyNode                                                    */
  84. /*                                                                      */
  85. /************************************************************************/
  86.  
  87. extern INLINE struct AnyNode *
  88. SearchNode (struct AVLTree *Tree, char *Name)
  89.  
  90. {
  91.   struct AnyNode AnyNode;
  92.  
  93.   AnyNode.Name = Name;
  94.   return (struct AnyNode *) AVL_SearchNode (Tree, &AnyNode.AVLNode);
  95. }
  96. #else
  97. struct AnyNode *SearchNode (struct AVLTree *, char *);
  98. #endif
  99.  
  100. #endif /* MAIN_H */
  101.